package org.btik.light.mobile.common.handler;




import org.btik.light.meta.event.cmd.DefaultCmd;

import java.util.ArrayList;
import java.util.Arrays;

public class SimpleCommand extends DefaultCmd {
    private static final ArrayList<String> EMPTY_PARAMS = new ArrayList<>();

    public SimpleCommand(int opcode, String... params) {
        this.opcode = opcode;
        this.params = asParam(params);
    }

    public static ArrayList<String> asParam(String... param) {
        if (param == null || param.length == 0) {
            return EMPTY_PARAMS;
        }
        ArrayList<String> strParam = new ArrayList<>(param.length);
        strParam.addAll(Arrays.asList(param));
        return strParam;
    }
}
